﻿package {
	
	import flash.events.Event;
	
	public class Bob extends ICharacter{
						
		public function Bob(){
			_fallspeed = 2;
			_jumpheight = 20;
			_special_1_keydown_action = init_special_action;
			_special_1_keyup_action = undo_special_action
			addEventListener("enterFrame", moveDown);
		};
													
		private function init_special_action(){
			addEventListener("enterFrame", fadeout);
			removeEventListener("enterFrame", fadein);
		}
		
		private function undo_special_action(){
			addEventListener("enterFrame", fadein);
			removeEventListener("enterFrame", fadeout);
		}
		
		private function fadeout(evt:Event){
			alpha -= .1;
			if (alpha <= .4){
				alpha = .4;
				removeEventListener("enterFrame", fadeout);
			}
		}
		
		private function fadein(evt:Event){
			alpha += .1;
			if (alpha > 1){
				alpha = 1;
				removeEventListener("enterFrame", fadein);
			}
		}
	}
	
}